<template>
  <div id="goodsType">
    <!-- 头部标签区域 -->
    <div class="top">
      <div><span></span>商品分类</div>
      <el-button size="mini" class="el-icon-refresh">刷新</el-button>
    </div>
    <!-- 表格区域 -->
    <div class="table-box">
      <div class="table-top">
        <div>
          <div class="top-left">
            <i class="el-icon-s-operation" />
            数据列表
          </div>
          <el-button size="mini" @click="addEvent()">添加</el-button>
        </div>
      </div>
      <div class="table-body">
        <el-table :data="tableData" style="width: 100%">
          <el-table-column prop="date" label="编号" align="center"> 10010</el-table-column>
          <el-table-column prop="name" label="分类名称" align="center">服装 </el-table-column>
          <el-table-column prop="date" label="级别" align="center">1 </el-table-column>
          <el-table-column prop="date" label="商品数量" align="center">100 </el-table-column>
          <el-table-column prop="date" label="数量单位" align="center">件 </el-table-column>
          <el-table-column prop="date" label="导航栏" align="center">
            <el-switch active-color="#13ce66" inactive-color="#0099ff"> </el-switch>
          </el-table-column>
          <el-table-column prop="date" label="是否显示" align="center">
            <el-switch active-color="#13ce66" inactive-color="#0099ff"> </el-switch>
          </el-table-column>
          <el-table-column prop="date" label="排序" align="center"> 1</el-table-column>
          <el-table-column prop="date" label="设置" align="center" width="200px">
            <div class="tools">
              <a> 新增下级</a>
              <a>查看下级</a>
              <a>转移商品</a>
            </div>
          </el-table-column>
          <el-table-column prop="date" label="操作" align="center">
            <div class="tools">
              <a> 编辑</a>
              <a>删除</a>
            </div>
          </el-table-column>
        </el-table>
        <div class="table-bottom">
          <el-pagination :page-sizes="[100, 200, 300, 400]" :page-size="100" layout="total, sizes, prev, pager, next, jumper" :total="400"> </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tableData: [
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }
      ],
      arr: [1, 2, 3]
    }
  },
  methods: {
    addEvent() {
      this.$router.push('/addGoods')
    }
  }
}
</script>
<style lang="less" scoped>
#goodsType {
  height: 100%;
  .top {
    position: relative;
    height: 50px;
    line-height: 50px;
    background-color: rgba(243, 243, 243, 1);
    border-bottom: 2px solid rgba(228, 228, 228, 1);
    margin-bottom: 20px;
    div {
      position: absolute;
      display: flex;
      left: 20px;
      font-size: 14px;
      color: #999;
      span {
        display: block;
        margin-top: 15px;
        margin-right: 5px;
        width: 5px;
        height: 20px;
        background-color: #039aff;
      }
    }
    .el-button {
      margin-left: 1240px;
    }
  }
  .table-box {
    border: #e4e4e4 solid 1px;
    margin: 12px 20px;
    .table-top {
      div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 50px;
        background-color: #f3f3f3;
        line-height: 50px;
        border-bottom: 1px solid #ccc;
        div {
          margin-left: 10px;
          vertical-align: middle;
          display: flex;
          span:nth-child(1) {
            line-height: 50px;
            margin-right: 5px;
          }
          span:nth-child(2) {
            font-size: 12px;
          }
        }
        .el-button {
          margin-right: 20px;
          height: 30px;
          align-content: center;
        }
      }
    }
    .table-body {
      .el-table-column {
        border-top: 1px solid #ccc;
      }
    }
  }
}
.tools {
  display: flex;
  justify-content: space-around;
  font-size: 12px;
  color: #0099ff;
  a {
    cursor: pointer;
  }
}
.table-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
}
</style>
